package com.eystar.pdc.model;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.eystar.ext.plugin.tablebind.ModelExt;
import com.eystar.ext.plugin.tablebind.TableBind;

/**
 * 收藏 Model
 * 
 * @author Your_Name
 * 
 */
@TableBind(tableName = "t_pdc_fav")
public class Fav extends ModelExt<Fav> {

	private static final long serialVersionUID = 1244431359124317083L;
	public final static Fav dao = new Fav();
	
	/**
	 * 查找某个用户已经收藏列表
	 * @param fav
	 * @return
	 */
	public List<Fav> findFavs(Fav fav){
		List<Fav> favs = find(getSqlPara("pdc.fav.findFavs", fav));
		return favs;
	}
	
	public void deleteFav(Fav fav) {
		Map<String, Object> columns = new HashMap<String, Object>();
		columns.put("res_id", fav.getStr("res_id"));
		columns.put("create_user", fav.getStr("create_user"));
		deleteByColumns(columns);
	}
}